<template>
  <div>
    <h3>App</h3>
    <button @click="isShow=!isShow">显示/隐藏</button>
    <transition name="atguigu">
      <div class="box"
           v-show="isShow"></div>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      isShow: true,
    }
  },
}
</script>

<style>
.box {
  width: 300px;
  height: 50px;
  background-color: skyblue;
}

@keyframes move {
  50% {
    transform: rotate(-180deg);
  }
  
}

.atguigu-enter-active {
  animation: 1s move linear reverse;
}
.atguigu-leave-active {
  animation: 1s move linear;
}

.atguigu-enter, .atguigu-leave-to{
    transform: translateX(-300px);
}
.atguigu-enter-to, .atguigu-leave{
    transform: translateX(0px);
}
</style>